<template>
    <view class="addr">
        <button @tap="open">
		</button>
        <cityPicker :column="column" :default-value="defaultValue" :mask-close-able="maskCloseAble" @confirm="confirm" @cancel="cancel" :visible="visible"/>
        <!-- <view >{{str}}</view> -->
    </view>
</template>

<script>
    import cityPicker from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker'
    export default {
        data() {
            return {
                visible: false,
                maskCloseAble: true,
                str: '',
                // defaultValue: '420103',
                defaultValue: ['','',''],
                column: 3
            }
        },
        components: {
            cityPicker
        },
        methods: {
			setDefaultValue(e){
				this.defaultValue = e
			},
            open () {
                this.visible = true
            },
            confirm (val) {
                console.log(val)
                this.str = val
                this.visible = false
				this.$emit('addrFun',val)
            },
            cancel () {
                this.visible = false
            }
        },
        onShareAppMessage(res) {
            if (res.from === 'button') { // 来自页面内分享按钮
                console.log(res.target)
            }
            return {
                title: 'data-cityPicker省市区地址选择器！',
                path: '/pages/cityPicker/cityPicker'
            }
        },
        onShareTimeline(res) {
            if (res.from === 'button') { // 来自页面内分享按钮
                console.log(res.target)
            }
            return {
                title: 'data-cityPicker省市区地址选择器！'
            }
        }
    }
</script>

<style lang="scss">
	.addr{
		color:#333333
	}
</style>